public class Test {
        public static int first(String s) {
            char[] cs = s.toCharArray();
            char[] chars = new char[128];
            for(int i = 0 ; i < cs.length; i++){
                chars[cs[i]]++;
            }
            for(int i = 0; i < cs.length; i++){
                if(chars[cs[i]] == 1){
                    return i;
                }
            }
            return -1;
        }

    public static void main(String[] args) {
            int a = first("laoo");
        System.out.println(a);
    }
}

